﻿namespace Quail.Silverlight
{
    /// <summary>
    /// The silveright numeric box control
    /// </summary>
    public class SlvNumericBox : SlvControl
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="SlvNumericBox"/> class.
        /// </summary>
        public SlvNumericBox()
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="SlvNumericBox"/> class.
        /// </summary>
        /// <param name="container">The container for the control.</param>
        /// <param name="selector">The selector.</param>
        public SlvNumericBox(SlvControlContainer container, string selector)
            : base(container, selector)
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="SlvNumericBox"/> class.
        /// </summary>
        /// <param name="control">The control.</param>
        public SlvNumericBox(SlvControl control)
            : base(control)
        {
        }

        /// <summary>
        /// Gets or sets the numeric value of the control
        /// </summary>
        public double Value
        {
            get
            {
                return double.Parse(GetPropertyValue("Value"));
            }

            set
            {
                SetPropertyValue("Value", value.ToString());
            }
        }
    }
}
